fix(ui): remove-all routes skips locked routes (#1298)#1370
fix(ui): remove-all routes skips locked routes (#1298)#1370iron-hope-shop wants to merge 2 commits intoAzgaar:masterfrom
Conversation
✅ Deploy Preview for afmg ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Looks good, thanks for the contribution! |
There was a problem hiding this comment.
Pull request overview
Updates the Routes Overview “Remove all” action to respect route locks, enabling users to clear generated/unwanted routes without deleting hand-pinned (locked) ones, aligning bulk-delete behavior with issue #1298.
Changes:
- Bulk delete now targets only unlocked routes and uses
Routes.removeper route to keep data + SVG in sync. - Adds user feedback when there are no routes or when all routes are locked (tip instead of confirmation).
- Updates confirmation wording and the trash button tooltip to clarify locked routes are retained.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/index.html | Updates the Routes Overview trash button tooltip to clarify it removes only unlocked routes. |
| public/modules/ui/routes-overview.js | Implements unlocked-only bulk deletion, adds empty/all-locked tips, and updates confirmation message/title accordingly. |
|
@iron-hope-shop, could you please address the comments? I will be able to merge then. |
|
the remove action now recomputes unlocked routes at confirm time, and after bulk removal |
| const lockedCount = pack.routes.length - toRemove.length; | ||
| alertMessage.innerHTML = | ||
| lockedCount > 0 | ||
| ? /* html */ `Remove all <b>unlocked</b> routes (${toRemove.length})? <b>${lockedCount}</b> locked route(s) will be kept. This cannot be undone.` | ||
| : /* html */ `Are you sure you want to remove all routes? This action can't be undone`; |
There was a problem hiding this comment.
The confirmation text/title are derived from toRemove/lockedCount computed before opening the #alert dialog, but the actual deletion list is recomputed inside the Remove handler. Because jQuery UI dialogs are non-modal by default, users can lock/unlock additional routes while the dialog is open, which can make the confirmed counts inaccurate and potentially delete more routes than the prompt indicated. Consider making this dialog modal (or otherwise preventing lock state changes while it’s open), or ensure the deletion always matches the exact set/count presented in the confirmation UI.
Summary
"Remove all routes" in the Routes Overview now deletes only unlocked routes. Locked routes and their geometry stay. Users who want a full wipe can unlock everything first (existing lock/unlock-all control).
Motivation
Implements the behavior requested in #1298: bulk delete should ignore locked routes so you can clear generated routes without losing hand-pinned or important ones.
Changes
How to test
#1298